[][src]Crate grin_store

Storage of core types using RocksDB.

Modules

leaf_set

The Grin leaf_set implementation. Compact (roaring) bitmap representing the set of leaf positions that exist and are not currently pruned in the MMR.

pmmr

Implementation of the persistent Backend for the prunable MMR tree.

prune_list

The Grin "Prune List" implementation.

types

Common storage-related types

Structs

Batch

Batch to write multiple Writeables to db in an atomic manner.

SerIterator

An iterator thad produces Readable instances back. Wraps the lower level DBIterator and deserializes the returned values.

Store

LMDB-backed store facilitating data access and serialization. All writes are done through a Batch abstraction providing atomicity.

Enums

Error

Main error type for this lmdb

Functions

new_env

Create a new LMDB env under the provided directory. By default creates an environment named "lmdb". Be aware of transactional semantics in lmdb (transactions are per environment, not per database).

new_named_env

TODO - We probably need more flexibility here, 500GB probably too big for peers... Create a new LMDB env under the provided directory with the provided name.

option_to_not_found

unwraps the inner option by converting the none case to a not found error

read_bitmap

Read Bitmap from a file

save_via_temp_file

Creates temporary file with name created by adding temp_suffix to path. Applies writer function to it and renames temporary file into original specified by path.

to_key

Build a db key from a prefix and a byte vector identifier.

to_key_u64

Build a db key from a prefix and a byte vector identifier and numeric identifier

u64_to_key

Build a db key from a prefix and a numeric identifier.